spyder (runfile, wdir) thing 路 Issue #4245 路 spyder

您所在的位置:网站首页 spyder runfile怎么更改 spyder (runfile, wdir) thing 路 Issue #4245 路 spyder

spyder (runfile, wdir) thing 路 Issue #4245 路 spyder

2023-12-28 19:18| 来源: 网络整理| 查看: 265

hi I get this when I run this code

runfile('C:/Users/23928352/Desktop/Data/Oulette Data/dVsVs_tailingsmonitoring-v1.0.0/smouellet-dVsVs_tailingsmonitoring-1946c58/dVsVs_model/bootstrap111.py', wdir='C:/Users/23928352/Desktop/Data/Oulette Data/dVsVs_tailingsmonitoring-v1.0.0/smouellet-dVsVs_tailingsmonitoring-1946c58/dVsVs_model')

my code is as followed

import numpy as np import numpy.ma as ma import matplotlib.pyplot as plt import pandas as pd import glob import pickle import warnings from scipy.optimize import curve_fit

def power_law(x, a, b): ''' function to calculate the power-law with constants a and b, power regression https://towardsdatascience.com/basic-curve-fitting-of-scientific-data-with-python-9592244a2509 ''' return a*np.power(x,b)

data =('246.21625, 245.880703, 254.3659374, 225.0877461, 196.1171558, 187.3530337, 194.0158701, 236.8535508, 216.3205735, 219.1345127, 220.1588209, 271.1956852, 252.5096355, 233.5736097, 266.6248149, 232.8743091, 235.0038656, 277.8716508, 273.6499699, 277.0085633, 270.8686827, 263.3479741, 274.9033048, 284.5929077, 300.8185136, 296.2480867, 287.9035012, 287.2630452, 271.0743376, 255.5661895, 255.5661895, 291.1639593, 286.0737274, 286.4689398, 243.7187511, 229.2538056, 233.840115, 272.8896547, 272.8896547, 279.0360369, 314.5366092, 312.7867422, 276.8108809, 225.960588, 217.9049541, 219.5853575, 215.3789965, 211.5859493, 323.9315706, 425.5204681, 425.5204681, 250.5235688, 250.5235688, 214.1308606, 245.7340042, 218.5696358, 206.5665107, 177.4679961, 253.8034486, 205.5990619, 205.5990619, 344.0152026, 344.0152026, 376.7296517, 364.855888, 343.1248006, 390.1699485, 301.4142349, 247.3893319, 209.9995888, 264.9998785, 259.8745213, 240.8566523, 255.8637935, 212.1278014, 173.5940309, 181.2534676, 193.8835929, 202.108593, 202.108593, 225.8572464, 373.7267181, 349.4690514, 317.934763, 300.6035164, 222.5083504, 174.1338717, 176.0705547, 168.0480074, 154.7931281, 242.4449276, 242.4449276, 238.342897, 192.332485, 250.7643385, 223.3885311, 232.3801265, 194.2173653, 277.6332371, 365.2965158, 456.090165, 456.090165, 298.8275148, 317.6707427, 309.8836251, 289.0980759, 229.8881282, 234.5556519, 294.7088213, 294.7088213, 169.7974675, 293.4672123, 301.4334517, 304.7845781, 282.7618765, 367.7037492, 276.2464457, 248.8334961, 239.2417128, 240.3703416, 240.3703416, 262.584183, 335.0056184, 346.7001541, 294.4372556, 223.4427217, 133.7702197, 156.2278439, 223.7919347, 274.381448, 274.381448, 235.4814555, 255.5419823, 217.1501303, 211.0373921, 243.7382609, 208.0963383, 213.9061126, 196.532685, 200.8728168, 207.091911, 267.6096439, 267.6096439, 236.3193636, 261.846135, 202.0992465, 199.3203971, 200.6468243, 398.7929392, 398.7929392, 232.951013, 191.3628842, 200.4850914, 200.4850914, 171.3023566, 180.0908181, 179.1778255, 167.3807663, 189.1671807, 207.7245204, 194.2085167, 208.246051, 208.246051, 330.7298082, 218.0742542, 188.3554354, 190.2516435, 192.3461481, 175.4516827, 181.9345235, 181.9345235, 352.6836804, 405.1741697, 173.3547771, 159.333604, 170.983715, 188.3163853, 174.0108208, 182.8493676, 203.4649293, 195.4139422, 193.2447544, 200.2916516, 188.3593927, 217.3299031, 206.3815359, 239.389073, 239.389073, 109.8719063, 133.9322831, 141.8873023, 139.0889777, 147.1844054, 158.2002649, 174.550106, 198.006545, 185.40981, 174.6694657, 174.6694657, 371.8157898, 245.1494582, 209.5324849, 222.3926607, 217.6424279, 237.437469, 243.7972173, 246.7335377, 261.7483905, 272.1500657, 290.1548193, 237.8545172, 282.1329705, 253.6395842, 280.5967969, 288.0356574, 293.7000681, 294.2935335, 310.3125214, 290.1140555, 290.302592, 292.3461961, 281.9570348, 288.1082233, 282.0352206, 269.8956978, 275.0544891, 288.0189293, 281.1727997, 279.3406941, 279.3406941, 327.1734188, 319.0742873, 315.9119962, 266.8458644, 299.3374991, 266.4431742, 379.0257197, 363.4144692, 441.9695664, 441.9695664, 199.1318645, 199.1318645, 263.6265277, 262.6058405, 331.991056, 176.7435854, 235.096614, 226.5996894, 226.2149551, 198.208141, 219.1823756, 194.1619675, 207.0225975, 181.4101305, 217.1328878, 252.0617249, 238.5602114, 261.2539273, 284.5089939, 260.8955787, 240.3853452, 252.0203495, 249.2583242, 252.4192558, 296.9779632, 289.9485624, 263.8157, 253.2968666, 285.5780332, 285.5780332, 410.5895387, 429.3040235, 345.8897425, 232.9763311, 200.6264331, 299.584674, 321.4020311, 250.8081093, 224.1319024, 287.2615565, 278.3144131, 270.1794385, 294.0645513, 308.2067984, 266.6107718, 290.4333311, 302.2409938, 283.9389982, 313.1884347, 284.7377435, 285.1006959, 313.8072562, 291.8040883, 297.11201, 293.4861514, 310.6104789, 307.8234985, 329.8036122, 321.5647678, 321.5647678, 333.2147325, 305.5004644, 312.7217736, 377.9688268, 320.9038364, 289.7106683, 269.5382596, 260.698032, 265.1000178, 298.2315553, 296.028181, 267.6892841, 256.3272132, 263.9278842, 248.082091, 218.0260848, 208.9734414, 213.9729049, 209.1604321, 209.1604321, 173.5906829, 148.7936493, 158.0587484, 164.169415, 185.8217096, 196.7321825, 229.9467087, 208.3951237, 247.9257186, 211.07948, 209.6935503, 212.712225, 240.9317363, 225.2951094, 252.7072568, 230.9549162, 257.457957, 228.2133134, 236.6163542, 240.1134765, 206.2992653, 199.680213, 174.1092265, 191.6215325, 283.5427561, 283.5427561, 288.5901042, 341.2061448, 310.9588668, 329.5205194, 294.8639416, 249.2967562, 220.6605151, 247.5916124, 255.5854128, 253.9668482, 259.6851969, 279.191733, 252.7609873, 284.9662036, 264.2741484, 206.2007003, 217.0235857, 247.2903054, 281.6088578, 280.7032711, 287.7528254, 276.644414, 261.2921115, 261.2921115, 331.4254607, 262.7862656, 247.3566415, 182.9381598, 199.9964912, 188.4351666, 205.7772277, 199.1055685, 221.7630288, 238.2683937, 221.2413238, 245.1379041, 273.7150184, 243.5690239, 224.9150593, 239.0364127, 249.7212504, 250.0454418, 243.2326406, 245.6694792, 239.275117, 239.4543239, 229.0564568, 223.9312134, 212.6622033, 201.9876617, 187.1457764, 191.3258879, 197.9801834, 205.415518, 205.415518, 402.5081721, 422.0433731, 372.0384116, 307.9691358, 221.6765533, 179.7546664, 188.7270494, 182.4203312, 180.8371899, 164.5803895, 164.5803895, 312.1509879, 357.4524249, 281.4351215, 235.60148, 187.4697207, 224.996642, 230.5621428, 226.5822791, 235.8704632, 217.1018769, 229.0928878, 255.4438396, 232.5573427, 224.3875348, 231.4286414, 211.2260675, 240.7513258, 240.7513258, 215.4645934, 196.5723644, 184.3695215, 180.106284, 181.3382323, 176.0590473, 192.1403145, 176.2245262, 189.6141423, 199.8108362, 185.8091762, 198.0680883, 180.391168, 164.554308, 167.3980963, 158.1845325, 132.6248608, 142.1900336, 142.1900336, 310.2728507, 351.3813557, 206.1171586, 405.6444097, 418.3340559, 374.8931415, 308.0754114, 312.319678, 262.5135126, 257.2688887, 274.2960563, 288.9778449, 329.5868471, 300.7453409, 270.8210543, 291.7113735, 272.2606018, 290.3807975, 292.0878855, 298.587938, 301.3117314, 301.3117314, 294.897008, 284.5617351, 197.4051983, 207.8066863, 161.2929689, 196.0013005, 214.9021, 243.0820578, 237.4407735, 213.2191649, 217.7334219, 200.3249068, 190.7853839, 180.1379585, 180.0348768, 171.5915502, 173.1825299, 184.3866141, 194.9661219, 251.4722985, 251.4722985, 312.9693399, 191.3720702, 157.3580063, 87.52611969, 105.6982485, 130.4819664, 162.0986717, 207.3851551, 207.3851551, 181.2863454, 161.9276149, 212.4493783, 212.4493783, 225.5361488, 140.0691726, 160.738644, 140.4548266, 117.0568039, 119.0822135, 126.5384824, 123.9258051, 123.9258051, 179.1531757, 182.8728116, 164.6567327, 167.5761122, 206.2119421, 206.2119421, 360.0481329, 379.3668766, 376.017036, 313.3442847, 278.5845978, 444.3153406, 602.3403151, 458.3208366, 295.7348843, 306.9619738, 414.7814827, 249.2539431, 236.7596346, 176.4474144, 187.7576923, 290.3795038, 271.7741092, 245.2187771, 199.4450228, 217.8968485, 226.3906795, 226.7335093, 256.2975589, 344.0674151, 344.0674151, 192.9533174, 196.0026534, 156.5724834, 174.5590446, 215.3390767, 154.0618153, 169.8699279, 182.2099677, 177.3976789, 180.3530265, 221.3258517, 251.2906709, 253.2751102, 235.6003731, 219.9704735, 243.4658194, 253.791726, 236.0873556, 248.4984147, 210.674479, 269.7220844, 269.7220844, 258.5407006, 237.897236, 198.7713075, 224.0500963, 200.6265142, 209.990421, 230.7721469, 378.4188088, 366.487218, 221.5958435, 192.9496901, 161.402813, 175.3485934, 174.7604339, 194.4322254, 194.4322254, 429.1239264, 424.7773399, 400.2180265, 261.9587415, 341.9333311, 341.9333311, 237.4692112, 312.5734574, 312.5734574, 165.4031559, 137.950209, 161.8559817, 166.2054328, 161.6733325, 205.6554071, 184.0429107, 189.4340852, 203.7905018, 269.4046805, 269.4046805, 145.8050759, 145.8050759, 355.1097704, 344.097297, 342.2694485, 375.0405578, 370.3276823, 338.2418738, 334.7813183, 269.6236215, 274.762789, 242.6213593, 243.3209458, 220.5765303, 215.9091992, 205.8102661, 210.1874847, 306.8568123, 360.9213679, 292.2418774, 295.7229806, 262.3553292, 245.9797703, 259.5416748, 223.9983735, 179.4790726, 176.3348454, 139.3076465, 140.8399744, 169.5288954, 203.1032181, 210.0909126, 181.3840707, 159.3770215, 156.6138152, 143.427187, 177.5660043, 177.5660043, 221.1485662, 246.6333432, 234.023796, 190.5933392, 188.1054172, 192.7948446, 209.6687428, 184.6660527, 189.1865328, 195.4300376, 203.3291628, 242.9862425, 248.540416, 248.540416, 280.2716401, 183.7214561, 188.5963838, 182.8289109, 220.8643877, 252.7213453, 252.7213453, 250.0213589, 250.0213589, 191.0176936, 197.5182026, 187.5585565, 196.5579562, 184.8026787, 201.8203527, 205.4656049, 232.1156633, 214.8618947, 221.8034396, 238.431593, 212.1766518, 187.1486365, 192.0353179, 216.2345388, 213.9343743, 225.8694265, 243.6350331, 240.7108971, 227.2256251, 231.7299731, 229.7620269, 203.2611891, 256.3744071, 256.3744071, 228.6904242, 205.6295792, 211.9747166, 225.5480614, 225.5480614, 145.1820173, 179.0598974, 81.13566431, 44.35916028, 56.27947339, 127.4106733, 175.9588595, 175.9588595, 312.6100473, 275.6641146, 252.3686081, 185.3865782, 165.6424635, 181.9915077, 174.819639, 185.0169836, 198.4159772, 194.1645725, 215.7423986, 228.7626701, 220.0195696, 247.019007, 230.8782615, 233.6030799, 241.2709411, 244.7686247, 257.023761, 258.5624575, 265.4101121, 262.6023189, 267.4542731, 254.5257923, 273.7304815, 273.0830039, 280.3202852, 284.760288, 283.4220362, 273.5201826, 238.5584324, 248.5804475, 248.5804475, 173, 198, 228, 173, 159, 187, 190, 197, 197, 194, 202, 209, 221, 225, 241, 241, 254, 249, 231, 238, 241, 261, 265, 275, 275, 268, 258, 260, 252, 256, 219, 237, 265, 272, 271, 281, 271, 200, 192, 192, 270, 270, 247, 156, 153, 158, 165, 168, 178, 182, 203, 194, 194, 261, 261')

def get_ecdf(data): ''' Returns x,y for ecdf https://towardsdatascience.com/calculating-confidence-interval-with-bootstrapping-872c657c058d ''' # Get lenght of the data into n n = len(data)

# We need to sort the data x = np.sort(data) # the function will show us cumulative percentages of corresponding data points y = np.arange(1,n+1)/n return x,y

def bootstrap(arr, n_boots,unit): #nsampls=len(arr[:,-1]) # if number samples equals full sample size nsampls=int(0.7*(len(arr[:,-1]))) # number of samples reduced to 70% - updated August 8 2022



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3